package itesm.coler.data;
import itesm.coler.data.UserDAO;

import java.sql.*;

//import com.google.appengine.api.rdbms.AppEngineDriver;

public class GoogleCloudSQLDAOFactory extends DAOFactory {
	// MySQL concrete DAO Factory implementation

	  public static final String DBURL="jdbc:google:rdbms://wavecolersql:wavecoler/wavecolertest";
	 
	  // method to create MySQL connections
	  public static Connection createConnection() {
	    // Use DRIVER and DBURL to create a connection
	    // Recommend connection pool implementation/usage
		  Connection connectionDB = null;
		  try {
			//DriverManager.registerDriver(new AppEngineDriver());
			connectionDB = DriverManager.getConnection(DBURL);
		  } catch (SQLException sqle) {
			  
	      }return connectionDB;
	  }
	  
	  public UserDAO getUserDAO(){
	    // MySQLCustomerDAO implements CustomerDAO
	    return new MySQLUserDAO();
	  }


	@Override
	public CourseDAO getCourseDAO() {
		return new MYSQLCourseDAO();
	}

	@Override
	public ProblemDAO getProblemDAO() {
		// TODO Auto-generated method stub
		return new MySQLProblemDAO();
	}
	  
	public TeamDAO getTeamDAO() {
		return new MYSQLTeamDAO();
	}
	
	public SessionDAO getSessionDAO() {
		return new MySQLSessionDAO();
	}
	
	@Override
	public WordDAO getWordDAO() {
		// TODO Auto-generated method stub
		return new MySQLWordDAO();
	}

	
	public MessageTypeDAO getMessageTypeDAO() {
		// TODO Auto-generated method stub
		return new MySQLMessageTypeDAO();
	}

	@Override
	public MessageCategoryDAO getMessageCategoryDAO() {
		// TODO Auto-generated method stub
		return new MySQLMessageCategoryDAO();

	}
	
	public MessageDAO getMessageDAO() {
		// TODO Auto-generated method stub
		return new MySQLMessageDAO();
	
	}
}